# deprecations warnings should be emitted for any variables which are planned for removal
#
# Specify the deprecation of variable 'FOO':
# 1. clear the default value of the variable and re-arrange all conditionals appropriately
# 1. add the announcement hint in this file:
#     ```
#     ifneq ($(FOO),)
#       MAKEFILET_DEPRECATION_WARNINGS += $(call MAKEFILET_EMIT_DEPRECATION_WARNING,FOO,Some explanation.)
#     endif
#     ```
#

MAKEFILET_DEPRECATION_PREFIX = DEPRECATION WARNING (makefilet):
# the suffix is just a simple line break
define MAKEFILET_DEPRECATION_SUFFIX

endef
MAKEFILET_EMIT_DEPRECATION_WARNING = $(MAKEFILET_DEPRECATION_PREFIX) '$(1)' is obsolet and will be removed. $(2)$(MAKEFILET_DEPRECATION_SUFFIX)
MAKEFILET_DEPRECATION_WARNINGS ?=

ifneq ($(DISABLE_CUSTOM_VIRTUALENV),)
	MAKEFILET_DEPRECATION_WARNINGS += $(call MAKEFILET_EMIT_DEPRECATION_WARNING,DISABLE_CUSTOM_VIRTUALENV,In the future 'makefilet' will not create virtual environments anymore by default. Please set 'PYTHON_VIRTUALENV_ENABLE=0' and remove 'DISABLE_CUSTOM_VIRTUALENV'.)
endif


# emit the collected warnings
ifneq ($(MAKEFILET_DEPRECATION_WARNINGS),)
	# "$(warning ...)" is not allowed outside of a target - thus we inject an error message via an assignment
	_ := $(shell echo >&2 "$(MAKEFILET_DEPRECATION_WARNINGS)")
endif
